package com.milhouz.bomberrokon.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.milhouz.bomberrokon.R;
import com.milhouz.bomberrokon.model.GameRound;

public class StartRoundDialog extends Dialog implements OnClickListener {

	private GameRound mGameRound;
	private View mStartButton;

	private TextView mStartText;

	public StartRoundDialog(Context context, GameRound gameRound) {
		super(context);
		mGameRound = gameRound;
	}

	@Override
	public void show() {
		super.show();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.start_round_dialog);

		mStartText = (TextView) findViewById(R.id.start_round_text);
		mStartText.setText("\nStart round " + mGameRound.getCurrentRound() + "\n");

		mStartButton = findViewById(R.id.startButton);
		mStartButton.setOnClickListener(this);
	}

	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.startButton:
			dismiss();
			// Debug.startMethodTracing("bbs_loop");
			mGameRound.start();
			break;
		}
	}
}
